home *** CD-ROM | disk | FTP | other *** search
/ Delphi 2.0 - Programmer's Utilities Power Pack / Delphi 2.0 Programmer's Utilities Power Pack.iso / a_to_d / dll101 / themain.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-09-15  |  936 b   |  40 lines

  1. {*This is the main form that will call our DLL}
  2. unit Themain;
  3.  
  4. interface
  5.  
  6. uses  {*Nothing need be added to the uses clause for this example}
  7.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  8.   Forms, Dialogs, StdCtrls;
  9.  
  10. {*Add this line of code}
  11. procedure LoadOurAboutbox(Handle: THandle); {*Export from our DLL}
  12.  
  13. type
  14.   TMainForm = class(TForm)
  15.     LoadAboutBtn: TButton;
  16.     procedure LoadAboutBtnClick(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. var
  24.   MainForm: TMainForm;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. {*Add this line of code}
  31. procedure LoadOurAboutbox; external 'THEDLL' index 1; {*Our procedure-
  32.                                    declaration and the name of the DLL}
  33.  
  34. procedure TMainForm.LoadAboutBtnClick(Sender: TObject);
  35. begin
  36.   LoadOurAboutbox(Application.Handle); {*Final step, load the Aboutbox}
  37. end;
  38.  
  39. end.
  40.